/*
 * Copyright (c) 2017. 深圳一七网络有限公司. All rights reserved.
 */

package com.yiqi.zhiyuan.framework.api;


import com.suozhang.framework.entity.bo.Result;
import com.suozhang.framework.entity.bo.UserInfoBo;
import com.yiqi.zhiyuan.entity.dto.DiverCertificationDTO;
import com.yiqi.zhiyuan.entity.dto.FeedbackDTO;
import com.yiqi.zhiyuan.entity.dto.RegisterDTO;
import com.yiqi.zhiyuan.entity.vo.CertufucateInfoVO;
import com.yiqi.zhiyuan.entity.vo.DiverCenterVO;
import com.yiqi.zhiyuan.entity.vo.FileVO;
import com.yiqi.zhiyuan.entity.vo.TextVO;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;

public interface UserApi {

    /**
     * 发送手机验证码
     *
     * @param mobile 手机号
     */
    @GET("api/driver/verificationCode/{phone}/{type}")
    Observable<Result<String>> sendCode(@Path("phone") String mobile, @Path("type") int type);

    /**
     * 司机注册
     *
     * @param registerDTO
     */
    @POST("api/driver/register")
    Observable<Result<UserInfoBo>> register(@Body RegisterDTO registerDTO);

    /**
     * 司机重置密码
     * POST /api/driver/
     *
     * @param registerDTO
     */
    @POST("api/driver/resetPwd")
    Observable<Result<UserInfoBo>> resetPwd(@Body RegisterDTO registerDTO);

    /**
     * 司机修改手机号
     * POST /api/driver/
     *
     * @param registerDTO
     */
    @POST("api/driver/updateOrcheckPhone")
    Observable<Result<UserInfoBo>>updatePhone(@Body RegisterDTO registerDTO);

    /**
     * 司机登录
     *
     * @param registerDTO
     */
    @POST("api/driver/login")
    Observable<Result<UserInfoBo>> login(@Body RegisterDTO registerDTO);

    /**
     * 司机登出
     *
     * @param
     */
    @POST("api/driver/logout")
    Observable<Result<UserInfoBo>> logout();

    /**
     * 司机认证上传基本资料
     */

    @POST("api/driver/fullInInfo")
    Observable<Result<String>> uploadInfo(@Body DiverCertificationDTO diverCertificationDTO);

    /**
     * 司机上传证件
     */
    @Multipart
    @POST("api/driver/updateCertInfo")
    Observable<Result<String>> uploadImage(@Part List<MultipartBody.Part> file,
                                           @Part("carColor") RequestBody carColor,
                                           @Part("carModelNo") RequestBody carModelNo,
                                           @Part("carName") RequestBody carName,
                                           @Part("carNo") RequestBody carNo,
                                           @Part("driverLicense") RequestBody driverLicense,
                                           @Part("bankCard") RequestBody bankCard,
                                           @Part("idCard") RequestBody idCard,
                                           @Part("realName") RequestBody realName,
                                           @Part("sex") RequestBody sex);

    /**
     * 获取司机个人中心数据
     */

    @POST("api/driver/driverCenter")
    Observable<Result<DiverCenterVO>> driverCenter();

    /**
     * 查询认证信息
     */
    @POST("api/driver/queryAuthInfo")
    Observable<Result<CertufucateInfoVO>> queryAuthInfo();

    /**
     * 新增车辆
     */
    @Multipart
    @POST("api/driver/insertOrUpdateCarInDriver")
    Observable<Result<String>> insertCarInDriver(@Part List<MultipartBody.Part> file,
                                                 @Part("carNo") RequestBody carNo,
                                                 @Part("carName") RequestBody carName,
                                                 @Part("carModelNo") RequestBody carModelNo,
                                                 @Part("carColor") RequestBody carColor,
                                                 @Part("id") RequestBody id);


    /**
     * 上传图片
     */

    @Multipart
    @POST("api/user/uploadFile")
    Observable<Result<FileVO>> uploadFile(@Part MultipartBody.Part imageUrl);

    /**
     * 意见反馈
     *
     * @param
     */
    @POST("api/driver/insertDriverFeedback")
    Observable<Result<String>> insertDriverFeedback(@Body FeedbackDTO feedbackDTO);


    /**
     * 修改头像
     *
     * @param
     */
    @Multipart
    @POST("api/driver/driverHeadPhotoImags")
    Observable<Result<FileVO>> driverHeadPhotoImags(@Part MultipartBody.Part imageUrl);

    /**
     * 关于我们
     *
     * @param
     */

    @POST("api/driver/selectAboutUs")
    Observable<Result<TextVO>> selectAboutUs();

    /**
     * 关于我们
     *
     * @param
     */

    @POST("api/driver/registrationAgreement")
    Observable<Result<TextVO>> registrationAgreement();
}
